#include "common.h"

using namespace wolv::condition;

std::string wolv::condition::Op2String(int op)
{
	switch(op)
	{
	case UNKNOWN : return "unknown";
	case E: return "==";
	case NE : return "!=";
	case GT : return ">";
	case GET : return ">=";
	case LT : return "<";
	case LET : return "<=";
	case IN : return "in";
	default: return "unknown";
	}
}

int wolv::condition::String2Op(const std::string& op)
{
	if (op == "==")
	{
		return E;
	}
	else if (op == "!=")
	{
		return NE;
	}
	else if (op == ">")
	{
		return GT;
	}
	else if (op == ">=")
	{
		return GET;
	}
	else if (op == "<")
	{
		return LT;
	}
	else if (op == "<=")
	{
		return LET;
	}
	else if (op == "in")
	{
		return IN;
	}
	else
	{
		return UNKNOWN;
	}
}

